// 发送热门推荐请求
$.ajax({
    type: 'get',
    url: '/posts/recommend',
    success: function (response) {
        var temp = `
        {{each data}}
        <li>
          <a href="detail.html?id={{$value._id}}">
            <img src="{{$value.thumbnail ||  './uploads/upload_cb7ae004ba4dd89c32bb23110ef60e92.png'}}" alt="">
            <span>{{$value.title}}</span>
          </a>
        </li>
        {{/each}}
        `
        var html = template.render(temp, {
            data: response
        })
        $('#recommendBox').html(html)
    }
})